﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Data.SqlClient;

namespace BenhVien
{
    class Connection
    {
        public SqlConnection con;

        public void Connect()
        {
            try
            {
                con = new SqlConnection("Server=IWANTWIN-PC; user id=sa; password=123456; database=QLBenhVien");
                con.Open();
            }catch(Exception e)
            {
                MessageBox.Show("Connect failed","Message",MessageBoxButtons.OK);
            }
        }
        public void DisConnect()
        {
            con.Close();
            con.Dispose();
            con = null;
        }
    }
}
